The embodiment relates to an apparatus and a method for searching for a programmable logic controller (PLC) data log.
A data log may be collected according to the input condition of device values of a PLC CPU and may be stored in a storage device such as a memory card as data. The stored data may be searched in match with the requirements of a user.
A data log module must store values processed by the PLC CPU at a high rate without loss. In this manner, when searching for the stored data while storing data at the high rate, many times are required and wrong values may be searched.
FIG. 1 is a flowchart illustrating a method of searching for PLC log data according to the related art.
Referring to FIG. 1, an apparatus for searching for a PLC data log receives a parameter for a search target from a user (S102) and receives a search request signal for the received parameter (S104).
Based on the data stored in a memory area, the apparatus for searching for a PLC data log determines whether the input parameter is in a parameter range of the data stored in the memory area (S108).
When the search target data are not included in the parameter range of the stored data (S110), the apparatus for searching for a PLC data log may continuously perform the search operation or arbitrarily terminate the search operation (S112).
In contrast, when the data parameter for the search target is within the parameter range of the stored data, the search target data are searched within the parameter range (S114). When the search data exist, the search data are output (S116).
In contrast, when there are no search data, the existence of the search data is searched again by reducing the parameter range to a half (S118).
As described above, according to the related art, when a time required to perform a search function becomes longer, the whole performance of the apparatus for searching for a data log may be degraded. That is, the method for searching for data according to the related art must search for data several times by applying a character string scheme when large amounts of data are stored in a memory. When searching for data using a character string comparison scheme, a search completion time is not clear and the search operation must be repeated to precisely search for the desired data. Accordingly, a search time may be delayed and a function of the apparatus may be degraded.